<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$list.title}</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">

    <link rel="stylesheet" href="__HOME__/css/weui.css">
    <link rel="stylesheet" href="__HOME__/css/jquery-weui.css">
    <link rel="stylesheet" href="__HOME__/css/style.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_689900_jcdrhysqlt.css">
    <style>
        .back1{position: relative;}
    </style>
</head>
<body class="back1">
<img src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=832274320,3445923886&fm=27&gp=0.jpg" style="visibility:hidden;height:0;width:0;" >
<div>
    <div class="index-top-fix">
        <a href="{:url('/store/parent.vote/index')}?shop_id={$shop_id}&uid={ssssss}" class="iconfont icon-left- left"></a>
        <p class="title">参赛详情</p>
    </div>
    <div class="swiper-container" style="margin-top: 42px;">
        <div class="swiper-wrapper">
            {if  $player_info != '' AND $player_info.check==1}
            {foreach name="player_info.pic_url" item="val" key="key"}
            <div class="swiper-slide">
                <img src="{$val}" alt="" style="width: 100%;height: 200px;">
            </div>
            {/foreach}
            {else /}
            {/if}

            {if  $banner_info != ''}
            {volist name="banner_info" id="vo"}
            <div class="swiper-slide">
                <a   href="{$vo['url']}">
                    <img src="{$vo['pic_url']}" alt="">
                </a>
            </div>
            {/volist}
            {else /}
            {if  $player_info == ''}
            <div class="swiper-slide">
                <a  href="#">
                    <img src="__STATIC__/home/images/mrbanner.jpg" alt="">
                </a>
            </div>
            {/if}
            {/if}
        </div>
        <div class="swiper-pagination"></div>
    </div>
    <div style="background: #fff;">

        <div style="background: #fff;">
            <h1  style="text-align: center;font-size: 20px">{$list.title}</h1>
            <div style="text-align: center;margin-top: 10px;">大赛时间:&nbsp;&nbsp;{$list.start_time|date='Y-m-d',###}&nbsp;~&nbsp;{$list.end_time|date='Y-m-d',###}</div>
            <div>
                {$list.content}
            </div>
        </div>


        <div class="weui-panel">
            {if  $player_info != ''}
            {foreach name="player_list" item="val" key="key"}
            {if $val.id==$player_info.id AND $player_info.check==1 AND $val.status==0}
            <div class="weui-panel__bd">
                <div class="weui-media-box weui-media-box_text">
                    <p class="weui-media-box__desc" style="font-size: 14px;margin-bottom: 8px;">{$player_info.id}号选手  {$player_info.name} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        当前排名:{$key+1}
                    <div style="width: 60%;float: left;padding-top: 8px;">
                        <div class="weui-progress">
                            <div class="weui-progress__bar">
                                <div class="weui-progress__inner-bar js_progress" style="width: {$percent}%;"></div>
                            </div>
                        </div>
                    </div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <span>{$player_info.vote_num}票</span>&nbsp;&nbsp;
                    <span>{$percent}%</span>
                </div>
            </div>
            {/if}
            {/foreach}
            {else /}
            {/if}


            <div class="weui-panel__hd">排行榜</div>
            {if $player_list != ''}
            {foreach name="player_list" item="val" key="key"}
            {if $key < 10  AND $val.check==1 AND $val.status==0}
            <div class="weui-panel__bd">
                <div class="weui-media-box weui-media-box_text">
                    <p class="weui-media-box__desc" style="font-size: 14px;margin-bottom: 8px;">当前排名:{$key+1}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$val.id}号选手  {$val.name}
                    <div style="width: 60%;float: left;padding-top: 8px;">
                        <div class="weui-progress">
                            <div class="weui-progress__bar">
                                <div class="weui-progress__inner-bar js_progress" style="width: {$val.percent}%;"></div>
                            </div>
                        </div>
                    </div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <span>{$val.vote_num}票</span>&nbsp;&nbsp;
                    <span>{$val.percent}%</span>
                </div>
            </div>
            {/if}
            {/foreach}
            {/if}

        </div>

        <div style="margin-top:84px;"></div>

        {if $from==''}
            {if  $player_info != '' AND $player_info.parent_id==$uid}
                {if  $check_info=='' AND $player_info.check==1}
                <div class='demos-content-padded' style="position: fixed;margin-bottom: 0px;width:90%;padding:5%;bottom: 0;left: 0;background-color: #fff;">
                    <a  class="weui-btn weui-btn_primary" style="background-color: #0bb20c" onclick="hit_own('{$player_info.id}')">立即投票</a>
                </div>
                {else/}
                <div class='demos-content-padded' style="position: fixed;margin-bottom: 0px;width:90%;padding:5%;bottom: 0;left: 0;background-color: #fff;">
                    <a  class="weui-btn weui-btn_primary" style="background-color: #0bb20c">火速审核中~</a>
                </div>
                {/if}
            {else/}
            <div class='demos-content-padded' style="position: fixed;margin-bottom: 0px;width:90%;padding:5%;bottom: 0;left: 0;background-color: #fff;">
                <a href="{:url('/store/parent.vote/add')}?act_id={$list.id}&shop_id={$shop_id}" class="weui-btn weui-btn_primary" style="background-color: #0bb20c">我要参赛</a>
            </div>
            {/if}
        {else/}
            {if  $player_info != '' AND $player_info.parent_id==$uid}
            <div class='demos-content-padded' style="position: fixed;margin-bottom: 0px;width:90%;padding:5%;bottom: 0;left: 0;background-color: #fff;">
                <a  class="weui-btn weui-btn_primary" style="background-color: #0bb20c" onclick="hit('{$send_uid}')">立即投票</a>
            </div>
            {else/}
                <div class='demos-content-padded' style="position: fixed;margin-bottom: 0px;width:100%;bottom: 0;left: 0;background-color: #fff;">

                    <a class="weui-btn weui-btn_primary" style="background-color: #0bb20c;width: 40%;float: left;margin-left: 5%;margin-top: 4%" onclick="hit('{$send_uid}')">立即投票</a>

                    <a style="background-color: #0bb20c;width: 40%;float: right;margin-right: 5%;margin-bottom: 3%" href="{:url('/store/parent.vote/add')}?act_id={$list.id}&shop_id={$shop_id}&uid={$uid}" class="weui-btn weui-btn_primary">我要参赛</a>

                </div>
            {/if}
        {/if}
    </div>
    <img src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=832274320,3445923886&fm=27&gp=0.jpg" style="visibility:hidden;height:0;width:0;" >



    <script src="__HOME__/js/jweixin-1.2.0.js"></script>
    <script src="__HOME__/js/jquery.min.js"></script>
    <script src="__HOME__/js/jquery-weui.min.js"></script>
    <script src="__HOME__/js/swiper.min.js"></script>
    <script>
        var mySwiper = new Swiper('.swiper-container', {
            autoplay: 3000,//可选选项，自动滑动
            speed:500,  //滑动速度
            pagination : '.swiper-pagination', // 分页器
            paginationType : 'bullets', //fraction 数字分页坐标  bullets 加点页坐标
            loop:true, // 连续循环
            autoplayDisableOnInteraction : false, // 滑动后继续滑动
            //autoHeight: true, //高度随内容变化
        });
        function AutoScroll(obj){
            $(obj).find("ul:first").animate({
                marginTop:"-40px"
            },500,function(){
                $(this).css({marginTop:"0px"}).find("li:first").appendTo(this);
            });
        }
        $(document).ready(function(){
            setInterval('AutoScroll("#scrollDiv")',3000);
        });

        wx.config({
            debug: false,
            appId: '{$jsconfig.appId}',
            timestamp: '{$jsconfig.timestamp}',
            nonceStr: '{$jsconfig.noncestr}',
            signature: '{$jsconfig.signature}',
            jsApiList: [
                'checkJsApi',
                'onMenuShareTimeline',
                'onMenuShareAppMessage',
                'onMenuShareQQ',
                'onMenuShareWeibo',
                'hideMenuItems',
                'showMenuItems',
                'hideAllNonBaseMenuItem',
                'showAllNonBaseMenuItem',
                'translateVoice',
                'startRecord',
                'stopRecord',
                'onRecordEnd',
                'playVoice',
                'pauseVoice',
                'stopVoice',
                'uploadVoice',
                'downloadVoice',
                'chooseImage',
                'previewImage',
                'uploadImage',
                'downloadImage',
                'getNetworkType',
                'openLocation',
                'getLocation',
                'hideOptionMenu',
                'showOptionMenu',
                'closeWindow',
                'scanQRCode',
                'chooseWXPay',
                'openProductSpecificView',
                'addCard',
                'chooseCard',
                'openCard',
            ]
        });

        wx.ready(function () {
            //分享到朋友圈
            wx.onMenuShareTimeline({
                title: '{$list.title}', // 分享标题
                imgUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1533704670439&di=820033252e7eae73788734e05c521bfc&imgtype=0&src=http%3A%2F%2Fimg.jzb.com%2Fbookimg%2Ffiles%2F30%2F14096666386156.jpg', // 分享图标
                desc: '动动小手，开启无限精彩~', // 分享描述
                link: "{$link_url}", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                type: '', // 分享类型,music、video或link，不填默认为link
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function () {
                    // 用户点击了分享后执行的回调函数
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                    alert("取消分享");
                },
                fail: function (res) {
                    alert(JSON.stringify(res));
                }
            });

            //分享给朋友
            wx.onMenuShareAppMessage({
                title: '{$list.title}', // 分享标题
                desc: '动动小手，开启无限精彩~', // 分享描述
                link: "{$link_url}", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                imgUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1533704670439&di=820033252e7eae73788734e05c521bfc&imgtype=0&src=http%3A%2F%2Fimg.jzb.com%2Fbookimg%2Ffiles%2F30%2F14096666386156.jpg', // 分享图标
                type: '', // 分享类型,music、video或link，不填默认为link
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function () {
                    // 用户点击了分享后执行的回调函数
                }
            });
        });
        //自己投票给自己
        function hit_own(id) {
            $.ajax({
                type: 'post',
                url: "{:url('hit_own')}",
                dataType: 'JSON',
                data: {player_id:id},
                success: function (res) {
                    if (res.code == 1) {
                        $.toast(res.msg, function () {
                        });
                    } else {
                        $.toast(res.msg ,function () {
                        })
                    }
                }
            })
        }
        //别人投票给自己
        function hit(send_uid){
            $.ajax({
                type: 'post',
                url: "{:url('hit')}",
                dataType: 'JSON',
                data: {send_uid:send_uid},
                success: function (res) {
                    if (res.code == 1) {
                        $.toast(res.msg, function () {
                        });
                    } else {
                        $.toast(res.msg ,function () {
                        })
                    }
                }
            })
        }
    </script>

</body>
</html>

